from typing import List
class Solution:
    def twoSum(self, nums: List[int], target: int) -> List[int]:
        hashtable = dict()
        for i, num in enumerate(nums):#i是索引，num是数值，num=nums[i]
            if target - num in hashtable:#判断在不在字典hashtable的Key值里面
                return [hashtable[target - num], i]
            hashtable[nums[i]] = i
        return []#如果没有满足的，就返回空

def main():
    S=Solution()
    NUM=[1,2,3,4,5,6]
    target=10
    a=S.twoSum(NUM,target)
    print(a)

main()